<UserControl x:Class="Bifrost.Mimir.Features.Core.Navigation.View"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
			 xmlns:LayoutToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
			 mc:Ignorable="d"
			 d:DesignHeight="300" 
			 d:DesignWidth="400"
			 DataContext="{Binding Source={StaticResource ViewModelLocator}, Path=Navigation}"
			 >

	<Grid x:Name="LayoutRoot" Background="White">
		<LayoutToolkit:Accordion ExpandDirection="Down"
								 HorizontalAlignment="Stretch"
								 ItemsSource="{Binding Categories}"
								 >

			<LayoutToolkit:Accordion.ItemTemplate>
				<DataTemplate>
					<StackPanel Orientation="Horizontal" Margin="0,4,0,4">
						<Image Source="{Binding Icon}"/>
						<TextBlock Text="{Binding Name}" Margin="8,0,0,0" VerticalAlignment="Center"/>
					</StackPanel>
				</DataTemplate>
			</LayoutToolkit:Accordion.ItemTemplate>
			
			<LayoutToolkit:Accordion.ContentTemplate>
				<DataTemplate>
					<ItemsControl ItemsSource="{Binding Pages}">
						<ItemsControl.ItemsPanel>
							<ItemsPanelTemplate>
								<StackPanel Orientation="Vertical"/>
							</ItemsPanelTemplate>
						</ItemsControl.ItemsPanel>
						<ItemsControl.ItemTemplate>
							<DataTemplate>
								<StackPanel Orientation="Horizontal" Margin="0,4,0,4">
									<Image Source="{Binding Icon}"/>
									<HyperlinkButton Content="{Binding Name}" 
													NavigateUri="{Binding NavigationUrl}" 
													TargetName="ContentFrame"
													 Margin="8,0,0,0"
													 />
								</StackPanel>
							</DataTemplate>
						</ItemsControl.ItemTemplate>
					</ItemsControl>
				</DataTemplate>
			</LayoutToolkit:Accordion.ContentTemplate>

		</LayoutToolkit:Accordion>

	</Grid>
</UserControl>
